﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.IO.Ports;
using System.Threading;

namespace AsTekMobile
{
    public class Printing
    {
        public static bool Print(string data)
        {
            try
            {
                string portName = Program.Session[Settings.YaziciPort].ToString();
                SerialPort port = new SerialPort(portName);
                port.Open();
                port.Write(data);
                Thread.Sleep(1000);
                port.Close();
                return true;
            }
            catch (Exception ex)
            {
                System.Windows.Forms.MessageBox.Show(ex.Message);
                return false;
            }
        }
    }
}
